package com.lemon.smartsafetynew.util.record;

import android.text.TextUtils;

/**
 * Created by JiangAn on 2018/5/30.
 */

public class LevelChangeUtils {
    private static String[] level = new String[]{" ","一级","二级","三级","四级","五级","六级","七级"};
    private static String[] level2 = new String[]{" ","一级","二级","三级","达标","未定级"};
    private static String[] monitorLevel = new String[]{" ","A","B","C","D"};
    private static String[] comStatus = new String[]{" ","正常","关停","转贸易","其它"};
    public static String numToString(String num,String type) {
        if(!TextUtils.isEmpty(num)){
            try {
                if(type.equals("type1")) {
                    return level[Integer.valueOf(num)];
                }else if(type.equals("type2")){
                    return level2[Integer.valueOf(num)];
                }
            }catch (Exception e){
                return "";
            }
        }else{
            return "";
        }
        return "";
    }

    public static String numToLetter(int num) {
        return  monitorLevel[num];
    }

    public static String statusNumToString(String organization_status) {
        if(!TextUtils.isEmpty(organization_status)){
            try {
               return comStatus[Integer.valueOf(organization_status)];
            }catch (Exception e){
                return "";
            }
        }else{
            return "";
        }
    }
}
